﻿<%@ Page Language="vb" AutoEventWireup="false"  MasterPageFile="~/Site.Master"  CodeBehind="Owner.aspx.vb" Inherits="ExpWeb.Owner" %>

<%@ Register Src="~/User_Control/ucUnitView.ascx" TagPrefix="uc1" TagName="ucUnitView" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class="row">
        <div class="col-md-2">
            <h3>Owner</h3>
        </div>
        <div class="col-md-10">
        </div>
    </div>

    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
        <asp:View ID="View1" runat="server">
<div class="col-lg-12">
                                <div class="col-lg-3">
                                <div class="form-group">
                                    <label>User Name :</label>
                                    <asp:DropDownList ID="ddlUserSearch" runat="server" CssClass="form-control"></asp:DropDownList>
                                    </div>
                            </div>
                    <div class="col-lg-3">
                                <div class="form-group">
                                    <label>Mobile Phone :</label>
                                    <asp:TextBox ID="txtMobileNumberSearch" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                    </div>
                    <div class="col-lg-3">
                                <div class="form-group">
                                    <label>First Name :</label>
                                     <asp:TextBox ID="txtFirstNameSearch" runat="server" CssClass="form-control"></asp:TextBox>     
                                </div>
                    </div>
                    <div class="col-lg-3">
                                <div class="form-group">
                                    <label>Last Name :</label>
                                    <asp:TextBox ID="txtLastNameSearch" runat="server" CssClass="form-control"></asp:TextBox>   
                                </div>
                    </div>
                        <div class="col-lg-3">
                                <div class="form-group">
                                    <label>Country :</label>
                                    <asp:DropDownList ID="ddlCountrySearch" runat="server" CssClass="form-control">
                                    </asp:DropDownList>    
                                </div>
                    </div>
                    <div class="col-lg-3">
                                <div class="form-group">
                                    <label>Brand :</label>
                                    <asp:DropDownList ID="ddlBrandSearch" runat="server" CssClass="form-control">
                                    </asp:DropDownList>    
                                </div>
                    </div>
                    <div class="col-lg-3">
                                <div class="form-group">
                                    <label>Resort :</label>
                                    <asp:DropDownList ID="ddlResortSearch" runat="server" CssClass="form-control">
                                    </asp:DropDownList>    
                                </div>
                    </div>
                    <div class="col-lg-3">
                                <div class="form-group">
                                    <label>Location :</label>
                                    <asp:TextBox ID="txtLocationSearch" runat="server" CssClass="form-control"></asp:TextBox>  
                                </div>
                    </div>
                <div class="col-lg-8 col-lg-offset-5 text-middle">
                    <asp:LinkButton ID="btn_search" runat="server" CssClass="btn btn-default"><span class="glyphicon glyphicon-search"></span> Search</asp:LinkButton>
                    </div>
                </div>


            <div class="row" style="margin-bottom: 5px;">
                <div class="col-lg-10 col-lg-offset-1 text-right">
                    <asp:LinkButton ID="btn_Add" runat="server" CommandArgument="View2" CommandName="SwitchViewByID" CssClass="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Add</asp:LinkButton>
                </div>
            </div>

            <div class="row">
                <div class="col-lg-10 col-lg-offset-1">

                    
                    <asp:GridView ID="gv_data" runat="server" AutoGenerateColumns="False" DataKeyNames="Unit_ID" CssClass="table table-hever" GridLines="None">
                        <HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#6B696B"></HeaderStyle>
                        <Columns>
                            <asp:BoundField DataField="Unit_ID" ItemStyle-Width="50" Visible="false" />
                            <asp:BoundField DataField="User_ID" ItemStyle-Width="50" Visible="false" />
                            <asp:TemplateField HeaderText="Edit" Visible="false">
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="top" Width="50px" />
                                <HeaderTemplate>
                                    <center>Edit</center>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ToolTip="Edit" CommandName="edit" CommandArgument='<%#Eval("Unit_ID") & "," & Eval("User_ID")%>' ID="LinkButton1">
                                    <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
                                    </asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Delete">
                                <HeaderTemplate>
                                    <center>
                            Delete</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="top" Width="90px" />
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" Visible="false" ToolTip="Delete" CommandName="Delete" CommandArgument='<%#Eval("Unit_ID") & "," & Eval("User_ID")%>' ID="LinkButton2" OnClientClick="return confirm('Make sure, Delete this one?');">
                                    <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
                                    </asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Delete">
                                <HeaderTemplate>
                                    <center>detail</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="top" Width="50px" />
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ToolTip="Detail" CommandName="Detail" CommandArgument='<%#Eval("Unit_ID") & "," & Eval("User_ID")%>' ID="LinkButton3">
                                    <span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span>
                                    </asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Resort Name</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="top" Width="150px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblResortName" runat="server" Text='<%# Eval("ResortName")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Unit Type</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="top" Width="150px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblUnitType_ID" runat="server" Text='<%# Eval("UnitType_ID")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                                                        <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Unit Number</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="top" Width="150px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblUnitName" runat="server" Text='<%# Eval("UnitName")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Owner</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="top" Width="200px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblUser_ID" runat="server" Text='<%# Eval("User_ID")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Brand</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="top" Width="150px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblBrand_ID" runat="server" Text='<%# Eval("Brand_ID")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Country</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="top" Width="150px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblCountry_Code" runat="server" Text='<%# Eval("CountryName")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <center>Quota</center>
                                </HeaderTemplate>
                                <ItemStyle HorizontalAlign="Right" VerticalAlign="top" Width="80px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblQuota" runat="server" Text='<%# Eval("quota")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
            </div><br /><br />
        </asp:View>

<asp:View ID="View2" runat="server">

            <div class="col-lg-6 col-lg-offset-3" style="margin-bottom:50px;">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <asp:Label ID="lblPanelHeader" runat="server" Text="Set Owner units"></asp:Label>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Owner Name :</label>
                                    <asp:DropDownList ID="ddl_User" runat="server" CssClass="form-control"></asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Brand :</label>
                                    <asp:DropDownList ID="ddl_Brand" runat="server" CssClass="form-control" AutoPostBack="True"></asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Resort :</label>
                                    <asp:DropDownList ID="ddl_Resort" runat="server" CssClass="form-control" AutoPostBack="True">
                                      
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="form-group">
                                    <label>Unit Number :</label>
                                    <asp:DropDownList ID="ddl_Unit" runat="server" CssClass="form-control" AutoPostBack="True">
                                    </asp:DropDownList>
                                    </div>
                            </div>
                            <asp:Panel ID="pnlQuota" runat="server" Visible="false">
                                <div class="col-lg-12">
                                    <div class="form-group">
                                        <label>Quota :</label>
                                            <asp:TextBox ID="txtQuota" runat="server" CssClass="form-control" MaxLength="3"></asp:TextBox>
                                        <label>Night</label><br />
                                    </div>
                                </div>
                            </asp:Panel>
                          

                            <div class="col-lg-3">
                            </div>

                            <div class="col-lg-3">
                            </div>

                            
                        </div><asp:HiddenField ID="HDFieldUserID" runat="server" />
                        <asp:HiddenField ID="HDFieldUnitID" runat="server" />
                    </div>
                    <div class="panel-footer">
                        <asp:Button ID="btn_Save" runat="server" Text="SAVE" CssClass="btn btn-default" />&nbsp;
                        <asp:Button ID="btn_Cancel" runat="server" CommandArgument="View1" CommandName="SwitchViewByID" Text="Cancel" CssClass="btn btn-default" />
                    </div>
                </div>
            </div>
            <br /><br />
        </asp:View>
                <asp:View ID="View3" runat="server">
            <div class="col-lg-12 col-lg-offset-9 text-middle">
                <asp:Button ID="btnBackView" runat="server" Text="Back" CssClass="btn btn-default" />
            </div>
            <div class="col-lg-8 col-lg-offset-2 text-middle">
                <uc1:ucUnitView runat="server" ID="ucUnitView" />
            </div>

        </asp:View>
    </asp:MultiView>


</asp:Content>


<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script type="text/javascript">
        ActiveMenuIndex(0);
    </script>
</asp:Content>
